/**
 * 
 */
package com.lenovo.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Repository;

import com.lenovo.dao.BaseDAO;
import com.lenovo.model.DConfigPara;
import com.lenovo.model.GCrawlerSystem;
import com.lenovo.model.GKeyword;
import com.lenovo.service.CrawlerSystemService;

/**
 * @author cxfallen
 *
 */
@Repository
public class CrawlerSystemServiceImpl implements CrawlerSystemService{

	@Resource
	private BaseDAO dao;
	
	@Override
	public List<GCrawlerSystem> browse() {
		// TODO Auto-generated method stub
		return dao.listAll("GCrawlerSystem") ;
	}

	@Override
	public GCrawlerSystem load(String id) {
		// TODO Auto-generated method stub
		return (GCrawlerSystem) dao.loadById(GCrawlerSystem.class, id);
	}

	@Override
	public boolean del(String id) {
		boolean status = false;
		try{
			dao.delById(GCrawlerSystem.class, id);
			status = true;
		}catch(Exception ex){
			ex.printStackTrace();
		}	
		return status;
	}

	@Override
	public boolean save(GCrawlerSystem obj) {
		// TODO Auto-generated method stub
		boolean status = false;
		try{
			dao.save(obj);
			status = true;
		}catch(Exception ex){
			ex.printStackTrace();
		}	
		return status;
	}
	
	@Override
	public boolean update(GCrawlerSystem obj) {
		boolean status = false;
		try{
			dao.update(obj);
			status = true;
		}catch(Exception ex){
			ex.printStackTrace();
		}	
		return status;
	}

}
